package com.yhd.cloud.controller;

import com.yhd.cloud.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 订单接口
 *
 * @author yinhuidong3@xiaomi.com
 * @since 2021/7/27
 */
@RestController
@RequestMapping("/order")
@Slf4j
public class OrderController {

    @Resource
    private OrderService orderService;

    @GetMapping("/add/{skuId}/{skuNum}")
    public String createOrder(@PathVariable("skuId")Integer skuId,
                              @PathVariable("skuNum")Integer skuNum){
        return orderService.createOrder(skuId,skuNum);
    }
}
